package com.mowh.gof23.behavioral.patterns.visitor;

/**
 * @author mowh1gd
 * @create 2023/10/20 9:38
 */
public class File extends Entry{
    private String name;
    private int size;

    public File(String name, int size) {
        this.name = name;
        this.size = size;
    }

    @Override
    public void accept(Visitor visitor) { //子类File实现Element接口，传入的visitor调用visit方法完成功能。
        visitor.visit(this);
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int getSize() {
        return size;
    }
}
